package com.miyake.dsp.osa.lab;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import com.miyake.dsp.ComplexArray;

public class MyCheckSum {

	private double[] data;

	public MyCheckSum(ComplexArray c) {
		this.data = c.getRealPart();
	}

	public String getCode() {
		String tmp = "";
		int step = data.length/100;
		if (step <= 0) {
			step = 1;
		}
		for (int i = 0; i < data.length; i += step) {
			if (i%2 == 0) {
				tmp += String.valueOf(data[i]);
			}
			else {
				tmp += String.valueOf(data[data.length-i-1]);
			}
			if (tmp.length() > 100) {
				break;
			}
		}
		return tmp;
	}

}
